<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>现代登录系统</title>
    <link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="styles.css">
</head>
<body>
    <div class="background-animation">
        <div class="gradient-sphere sphere-1"></div>
        <div class="gradient-sphere sphere-2"></div>
        <div class="gradient-sphere sphere-3"></div>
    </div>

    <div class="login-wrapper">
        <div class="login-card">
            <div class="login-header">
                <div class="logo">
                    <i class="fas fa-rocket"></i>
                </div>
                <h1>欢迎回来</h1>
                <p>请登录您的账户</p>
            </div>

            <form class="login-form" id="loginForm">
                <div class="input-group">
                    <label for="username">用户名</label>
                    <div class="input-container">
                        <i class="fas fa-user"></i>
                        <input 
                            type="text" 
                            id="username" 
                            placeholder="输入您的用户名"
                            autocomplete="username"
                        >
                    </div>
                    <span class="error-message" id="usernameError"></span>
                </div>

                <div class="input-group">
                    <label for="password">密码</label>
                    <div class="input-container">
                        <i class="fas fa-lock"></i>
                        <input 
                            type="password" 
                            id="password" 
                            placeholder="输入您的密码"
                            autocomplete="current-password"
                        >
                        <button type="button" class="toggle-password" id="togglePassword">
                            <i class="fas fa-eye"></i>
                        </button>
                    </div>
                    <span class="error-message" id="passwordError"></span>
                </div>

                <div class="form-options">
                    <label class="checkbox-container">
                        <input type="checkbox" id="rememberMe">
                        <span class="checkmark"></span>
                        <span class="checkbox-label">记住我</span>
                    </label>
                    <a href="#" class="forgot-link">忘记密码？</a>
                </div>

                <button type="submit" class="login-button" id="loginButton">
                    <span class="button-text">登录</span>
                    <div class="loading-spinner" id="loadingSpinner"></div>
                </button>
            </form>

            <div class="login-footer">
                <p>还没有账户？ <a href="#">立即注册</a></p>
            </div>
        </div>

        <div class="success-modal" id="successModal">
            <div class="modal-content">
                <div class="success-icon">
                    <i class="fas fa-check"></i>
                </div>
                <h3>登录成功！</h3>
                <p>正在为您跳转...</p>
            </div>
        </div>

        <div class="error-modal" id="errorModal">
            <div class="modal-content">
                <div class="error-icon">
                    <i class="fas fa-times"></i>
                </div>
                <h3>登录失败</h3>
                <p id="errorMessage"></p>
                <button class="close-btn" onclick="closeErrorModal()">关闭</button>
            </div>
        </div>
    </div>

    <script src="script.js"></script>
</body>
</html>